//
//  KZExamItemSubjectView.m
//  lg_zhinengbeikao_english
//
//  Created by 朱凯 on 2019/1/9.
//  Copyright © 2019 zhukai. All rights reserved.
//

#import "KZExamItemSubjectView.h"

// view
#import "KZSubjectClassWrittingView.h"      // 作文题干
#import "KZSubjectClassFillingView.h"       // 填空题干
#import "KZSubjectClassSelectingView.h"     // 选择题干


@implementation KZExamItemSubjectView
{

}

- (instancetype)init {
    if (self = [super init]) {
        
    }
    return self;
}
- (void)setupUI {
    
    switch (_model.type) {
        case KZExamItemWritting:    // 作文
        {
            KZSubjectClassWrittingView *subjectView = [KZSubjectClassWrittingView new];
            subjectView.model = _model;
            [self addSubview:subjectView];
            [subjectView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.right.top.height.equalTo(self);
            }];
        }
            break;
        case KZExamItemFilling:     // 填空
        {
            KZSubjectClassFillingView *subjectView = [KZSubjectClassFillingView new];
            subjectView.model = _model;
            [self addSubview:subjectView];
            [subjectView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.right.top.height.equalTo(self);
            }];
        }
            break;
        case KZExamItemSelecting:     // 填空
        {
            KZSubjectClassSelectingView *subjectView = [KZSubjectClassSelectingView new];
            subjectView.model = _model;
            [self addSubview:subjectView];
            [subjectView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.right.top.height.equalTo(self);
            }];
        }
            break;
            
            
        default:
            break;
    }
   
}

#pragma mark - setter
- (void)setModel:(KZExamItemModel *)model {
    
    _model = model;
    [self setupUI];
}

@end
